.\" Process this file with
.\" groff -man -Tascii tsh.1
.\"
.TH TSH 1 "OCTOBER 2014" Linux "User Manuals"

.SH NAME
tsh \- A tiny shell project

.SH SYNOPSIS
.B command argument_1 argument_2 ... argument_n

.SH DESCRIPTION
For this project, we implement a tiny shell, which can run a few commands similar to the Linux's. The commands are bash(1), bg, cat(1), cd, echo(1), fg, grep(1), groff(1), jobs, ls(1), mkdir(1), pwd(1), wc(1), whatis(1), and which(1). In case, users need to add any option and arguments for the commands in the same way as they do while using Linux shells, they are able to refer to the Linux command man pages for more details. Moreover, users can type ctrl-c and ctrl-z to send a SIGINT and SIGTSP signal to current processes causing the process to terminate and stop respectively.

.SH DESIGN
The important decision designs we made when coding tsh are how to organize the process, how to raise signals to the stopped or running processes, and when to fork a new child process. Each process has its own process id and group id inheriting from its parent which is the our shell, and its inheritances will have an impact on the way signals are raised. Hence, we have to create a new group id for childdescendant process every time it is forked so that the sent signals will not interrupt the parent or the shell. The processes additionally need grouping into two main categories as foreground and background jobs, because every processes must be assigned freely to either of the two jobs and changed its status from running to stopping and vice versa. As consequence of this approach, we choose to send the signal to all descentdant processes in the same process group id inividually without any side effect. To keep track of the background processes, we agree that the linked lists is needed. Last, since some commands such as cd will change the environment of the shell instead of the child process, the shell does not have to fork a child process to run the command, and the changed environment stays with the parent, not disappears when the child process ends. We take these reasons into account before implementing the projects.

.SH AUTHOR
Panitan Wongse-ammat NetID pwa732 <Panita.nW at u.northwestern dot edu>
Terrace Law  NetID < at u.northwestern dot edu>

.SH "SEE ALSO"
.BR bash(1),
.BR cat(1),
.BR echo(1),
.BR grep(1),
.BR groff(1),
.BR ls(1),
.BR mkdir(2),
.BG signal(7)
.BR pwd(1),
.BR wc(1),
.BR whatis(1),
.BR which(1)



